﻿using MediatR;
using T.Basic.API.Appliction.Command.CargoOwnerCommand;
using T.Basic.API.Appliction.Command.LineCommand;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.API.Appliction.CommandHandlers.CargoOwnerHanders
{
    /// <summary>
    /// 修改货主信息
    /// </summary>
    public class CargoOwnerUpdateCommandHandler : IRequestHandler<CargoOwnerUpdateCommand, int>
    {
        private readonly ICargoOwnerRepository _CargoOwnerrepository;
        public CargoOwnerUpdateCommandHandler(ICargoOwnerRepository cargoOwnerrepository)
        {
            _CargoOwnerrepository = cargoOwnerrepository;
        }

        public async Task<int> Handle(CargoOwnerUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _CargoOwnerrepository.UpdateAsync(request);
        }
    }
}
